/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Random;

/**
 * <p>Project: jse2204 - Out2
 * <p>Powered by webrx On 2022-09-02 11:27:50
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Out2 {
    public static void main(String[] args) {
        System.out.printf("\33[32m%s%n","Hello - 32 - RED");

        System.out.println();
        System.out.println("--------------------");
        System.out.println();

        for (int i = 1; i <= 6; i++) {
            //前景 字的颜色
            System.out.printf("\033[%dm%s\033[0m%n", 30 + i, "hello" + i); //

            //背景
            System.out.printf("\033[%dm\033[32m%s\033[0m%n", 40 + i, "hello" + i);
        }
        System.out.println();
        System.out.println("--------------------");
        System.out.println();


        Random backgroundRandom = new Random();
        Random fontRandom = new Random();
        for (int i = 1; i <= 50; i++) {
            int font = fontRandom.nextInt(6) + 31;
            int background = backgroundRandom.nextInt(6) + 41;
            System.out.format("前景色是%d,背景色是%d------\33[%d;%d;4m我是博主%n", font, background, font, background);
        }
    }
}
